package com.zzx.work1;

public class Cars {

	private double price;
	private String brand;
	private double displacement;
	private int soup;
	private String color;

	public double getPrice() {
		return price;
	}

	public void setPrice(double price) {
		this.price = price;
	}

	public String getBrand() {
		return brand;
	}

	public void setBrand(String brand) {
		this.brand = brand;
	}

	public double getDisplacement() {
		return displacement;
	}

	public void setDisplacement(double displacement) {
		this.displacement = displacement;
	}

	public int getSoup() {
		return soup;
	}

	public void setSoup(int soup) {
		this.soup = soup;
	}

	public String getColor() {
		return color;
	}

	public void setColor(String color) {
		this.color = color;
	}

	@Override
	public String toString() {
		return "Car [price=" + price + ", brand=" + brand + ", displacement=" + displacement + ", soup=" + soup
				+ ", color=" + color + "]";
	}

	public Cars(double price, String brand, double displacement, int soup, String color) {
		this.price = price;
		this.brand = brand;
		this.displacement = displacement;
		this.soup = soup;
		this.color = color;
	}

	public Cars() {
	}

	@Override
	public boolean equals(Object obj) {
		Cars ccars=(Cars) obj;
		return this.brand.equals(ccars.brand);
	}
	
	@Override
	public int hashCode() {
		return this.brand.hashCode();
	}
}
